
import Index from '../pages/index/Index';
import Chat from '../pages/chat/Chat'
import Aoth from '../pages/aoth/aoth'

//1.引入一个方法和一个组件
//createBrowserRouter -创建路由实例 在方法中定义路由path和组件的对应关系
//RouterProvider - 作为一个组件渲染 并且传入createBrowserRouter执行之后生成的router实例
import { createBrowserRouter } from 'react-router-dom'

var basename = "/personalchat";

//2、调用create方法生成实例
const router = createBrowserRouter([
  {
    path: basename+'/chat',
    element: <Chat />
  },
  {
    path: basename+'/index',
    element: <Index />
  },
  {
    path: basename+'/',
    element: <Aoth />
  },
])

export default router;